//
//  THTableViewModel.m
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 HZMengLiao. All rights reserved.
//

#import "THTableViewModel.h"

@interface THTableViewModel ()

@end

@implementation THTableViewModel


- (void)commit{
    [super commit];
    _pullRefreshEnable     = NO;
    _infiniteReFreshEnable = NO;
    _pageCount  = 0;
    _pageSize   = 20;
    _tableViewStyle =  UITableViewStylePlain;
    
    _insetsTop     = 0.0f;
    _insetsLeft    = 0.0f;
    _insetsBottom  = 0.0f;
    _insetsRight   = 0.0f;
    _contentInsets = UIEdgeInsetsMake(_insetsTop,_insetsLeft,_insetsBottom,_insetsRight);
}
#pragma mark  MJ_Refresh
- (MJRefreshHeader*)mj_header
{
    if (!_mj_header) {
        MJRefreshStateHeader *mj_header = [[MJRefreshStateHeader alloc] init];
        [mj_header setTitle:@"正在加载中,请稍后" forState:MJRefreshStateRefreshing];
        [mj_header setTitle:@"" forState:MJRefreshStateIdle];
        mj_header.lastUpdatedTimeLabel.hidden = YES;//将时间隐藏
        _mj_header = mj_header;
    }
    return _mj_header;
}

- (MJRefreshAutoNormalFooter*)mj_footer
{
    if (!_mj_footer) {
        MJRefreshAutoNormalFooter *mj_footer = [[MJRefreshAutoNormalFooter alloc] init];
        [mj_footer setTitle:@"" forState:MJRefreshStateIdle];
        [mj_footer setTitle:@"" forState:MJRefreshStatePulling];
        [mj_footer setTitle:@"" forState:MJRefreshStateRefreshing];
        [mj_footer setTitle:@"" forState:MJRefreshStateWillRefresh];
        [mj_footer setTitle:@"没有更多了~" forState:MJRefreshStateNoMoreData];
        _mj_footer = mj_footer;
    }
    return _mj_footer;
}
@end
